home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / Falcon / CENTEK / CENTSCRN / DEV / DEVEL_E.TXT
Encoding:
Text File  |  1999-02-15  |  23.0 KB  |  1,242 lines

  1.                      *---------------------------*
  2.                      *    Coder Documentation    *
  3.                      *---------------------------*
  4.                      *       Video system        *
  5.                      *           of              *
  6.                      *       CENTScreen          *
  7.                      *    DOLMEN Compatible      *
  8.                      *---------------------------*
  9.  
  10.                                                    Author: Sacha Hnatiuk
  11.                                                       ASM: Sacha Hnatiuk
  12.                                                    C: David René-Loiseau
  13.                                                  Hotline from 21h to 23h
  14.                                                     form mardi to samedi
  15.                                                           at 344-746-330
  16.                                             or e-mail centek@graphity.fr
  17. Introduction
  18. ------------
  19.  
  20.   It will come later...
  21.  
  22.                 *--------start of the functions----------*
  23.  
  24. Getrez ($04)
  25. ------------
  26.   
  27.   Return the current resolution
  28.  
  29.     It's the old call to know the current resolution.
  30.       0 for Low ST
  31.       1 for Med ST
  32.       2 for High ST 
  33.     In the other case, it return 3, the default value for Falcon modes.
  34.  
  35.   Parameters:
  36.     Nothing
  37.  
  38.   Answer:
  39.     D0 (word): resolution
  40.   
  41.   ASM 1: 
  42.     move.w    #4,-(sp)
  43.     trap    #14
  44.     addq.l    #2,sp
  45.        
  46.   ASM 2:
  47.       include    XBIOS.EQU
  48.       
  49.       XBIOS    Getrez
  50.  
  51.   C:  
  52.       #include    <tos.h>
  53.     int    Getrez( void )
  54.  
  55.  
  56. Setscreen ($05)
  57. ---------------
  58.  
  59.   Change the resolution:
  60.  
  61.     Use this function in priority for all changement of resolution because
  62.   it realloc the screen an initialise the VDI.
  63.  
  64.     Whatever the screen adress composed of 0, the reallocation of the screen is
  65.   doing.
  66.  
  67.   Parameters:
  68.     Log (long): Pointeur to the logical screen or 0 to realloc the screen
  69.     Phys (long): Pointeur to the physical screen or 0 to realloc the screen
  70.     Rez (word): 3 for Falcon mode
  71.     Mode (word): video mode
  72.  
  73.   Answer:
  74.     D0 (word): the old video mode
  75.  
  76.   ASM 1: 
  77.     move    #mode_video,-(sp)
  78.     move    #3,-(sp)
  79.     move.l    #log_base,-(sp)
  80.     move.l    #phys_base,-(sp)
  81.     move.w    #5,-(sp)
  82.     trap    #14
  83.     addq.l    #14,sp
  84.        
  85.   ASM 2:
  86.       include    XBIOS.EQU
  87.       
  88.     move    #mode_video,-(sp)
  89.     move    #3,-(sp)
  90.     move.l    #log_base,-(sp)
  91.     move.l    #phys_base,-(sp)
  92.       XBIOS    Setscreen
  93.   C:
  94.     #include    <tos.h>
  95.     void    Setscreen( void *laddr, void *paddr, int rez );
  96.  
  97.  
  98. Vread ($41)
  99. -----------
  100.  
  101.   Inquire on the actual video mode:
  102.  
  103.     In one call, you can know all the informations on the video mode
  104.   installed.
  105.  
  106.   Parameters:
  107.     Long: pointeur to an array:
  108.  
  109.           offset 0
  110.           word: handle
  111.           word: video mode like on Falcon
  112.           word: width of the physical screen
  113.           word: height of the physical screen
  114.           word: number of plane
  115.           word: width of the virtual screen
  116.           word: height of the virtual screen
  117.           word: delay in seconds before shut down
  118.           word: delay in seconds between the shut down and the Energy
  119.                Star mode
  120.           word: width of the screen in mm (used under Dolmen)
  121.           word: height of the screen in mm
  122.           
  123.           offset +64
  124.           bytes: name of the video mode (32 bytes maxi) terminated
  125.                   by a 0.
  126.  
  127.   Answer:
  128.     the array is full.
  129.  
  130.   ASM 1: 
  131.     move.l    #Result,-(sp)
  132.     move.w    #$41,-(sp)
  133.     trap    #14
  134.     addq.l    #6,sp
  135.        
  136.   ASM 2:
  137.       include    XBIOS.EQU
  138.       
  139.     move.l    #Result,-(sp)
  140.       XBIOS    Vread
  141.   C:        
  142.       #include    <dolmen.h>
  143.     void    Vread(VDO_PARAM *Result);
  144.  
  145. Vwrite ($42)
  146. ------------
  147.  
  148.   Change the screen resolution
  149.  
  150.     It is possible to initialized the VDI to use its functions directly.
  151.   It make an realloc at the same time.
  152.  
  153.     With the in-array (see the desciptor in the last function), you can
  154.   send the new desire resolution:
  155.  
  156.     - handle <>-1: it's the handle of a known video mode (like the
  157.       start resolution). You can give the virtual size with a value different
  158.       of -1, else it take the original virtual size.
  159.     - handle = -1: the resolution must be given and could be adjust by virtual
  160.       size like before. The search of your resolution take the resolution
  161.       smaller or equal and add virtual screen if needed.
  162.  
  163.     After the call, the out-array contains the real resolution made.
  164.  
  165.     If an error occur, the actual resolution is return with -1 for d0.
  166.  
  167.   parameters:
  168.     word: reset the VDI if different of 0
  169.     Long: in parameters
  170.     Long: out parameters
  171.  
  172.   Answer:
  173.     the out-arry is full.
  174.     D0=0 : no error
  175.     D0=-1: error
  176.     
  177.   ASM 1: 
  178.     move.l    #OutParam,-(sp)
  179.     move.l    #InParam,-(sp)
  180.     move.w    #$42,-(sp)
  181.     trap    #14
  182.     lea    10(sp),sp
  183.        
  184.   ASM 2:
  185.       include    XBIOS.EQU
  186.       
  187.     move.l    #OutParam,-(sp)
  188.     move.l    #InParam,-(sp)
  189.       XBIOS    Vwrite
  190.   C:
  191.       #include    <dolmen.h>
  192.     int     Vwrite(int InitVDI, VDO_PARAM *InParam, VDO_PARAM *OutParam);
  193.     
  194. Vattrib ($43)
  195. -------------
  196.  
  197.   Change the attributs of a video mode
  198.  
  199.     You can change the original mode with this function.
  200.     
  201.     ...
  202.  
  203.   parameters:
  204.     Long: in parameters
  205.     Long: out parameters
  206.  
  207.   Answer:
  208.     the out-array is full.
  209.  
  210.   ASM 1: 
  211.     move.l    #OutParam,-(sp)
  212.     move.l    #InParam,-(sp)
  213.     move.w    #$43,-(sp)
  214.     trap    #14
  215.     lea    10(sp),sp
  216.        
  217.   ASM 2:
  218.       include    XBIOS.EQU
  219.       
  220.     move.l    #OutParam,-(sp)
  221.     move.l    #InParam,-(sp)
  222.       XBIOS    Vattrib
  223.   C:        
  224.       #include    <dolmen.h>
  225.     void    Vattrib (VDO_PARAM *InParam, VDO_PARAM *OutParam);
  226.  
  227. Vcreate ($44)
  228. -------------
  229.  
  230.   Add a video mode
  231.  
  232.     It take directly the videl parameters and  affect a new handle on it with
  233.   your parameters.
  234.     
  235.     It use by CENTvidel.
  236.     
  237.     ...
  238.     
  239.   parameters:
  240.     Long: in parameters
  241.     Long: out parameters
  242.  
  243.   Answer:
  244.     The out array is full.
  245.  
  246.   ASM 1: 
  247.     move.l    #OutParam,-(sp)
  248.     move.l    #InParam,-(sp)
  249.     move.w    #$44,-(sp)
  250.     trap    #14
  251.     lea    10(sp),sp
  252.        
  253.   ASM 2:
  254.       include    XBIOS.EQU
  255.       
  256.     move.l    #OutParam,-(sp)
  257.     move.l    #InParam,-(sp)
  258.       XBIOS    Vcreate
  259.   C:        
  260.       #include    <dolmen.h>
  261.     void    Vcreate (VDO_PARAM *InParam, VDO_PARAM *OutParam);
  262.  
  263.  
  264. Vdelete ($45)
  265. -------------
  266.  
  267.   Delete a video mode
  268.     
  269.     Don't move the handles but compress the internal data. After a save-load
  270.   sequence, the handles may be change.
  271.  
  272.   parameters:
  273.     word: handle to delete.
  274.  
  275.   Answer:
  276.     D0=0 : no error.
  277.     D0=-1 : bad handle.
  278.  
  279.   ASM 1: 
  280.     move.w    #Handle,-(sp)
  281.     move.w    #$45,-(sp)
  282.     trap    #14
  283.     addq.l    #4,sp
  284.        
  285.   ASM 2:
  286.       include    XBIOS.EQU
  287.       
  288.     move.w    #Handle,-(sp)
  289.       XBIOS    Vdelete
  290.   C:        
  291.       #include    <dolmen.h>
  292.     int    Vdelete(int Handle);
  293.  
  294. Vfirst ($46)
  295. ------------
  296.  
  297.   Search the first video mode
  298.  
  299.     ...
  300.  
  301.   parameters:
  302.     long: in-mask
  303.     long: out-array
  304.  
  305.   Answer:
  306.     D0=0 : the out-array is full. 
  307.     D0=-1 : no mode match
  308.  
  309.   ASM 1: 
  310.     move.l    #Mode,-(sp)
  311.     move.l    #Mask,-(sp)
  312.     move.w    #$46,-(sp)
  313.     trap    #14
  314.     lea    10(sp),sp
  315.        
  316.   ASM 2:
  317.       include    XBIOS.EQU
  318.       
  319.     move.l    #Mode,-(sp)
  320.     move.l    #Mask,-(sp)
  321.       XBIOS    Vfirst
  322.   C:
  323.       #include    <dolmen.h>
  324.     int    Vfirst(VDO_PARAM *Mask, VDO_PARAM *Mode);
  325.  
  326.  
  327. Vnext ($47)
  328. -----------
  329.  
  330.   Next video mode
  331.  
  332.     ...
  333.   
  334.   parameters:
  335.     long: in-mask with the last handle found
  336.     long: out-array
  337.  
  338.   Answer:
  339.     D0=0: the array is full
  340.     D0=-1: no mode match.
  341.  
  342.   ASM 1: 
  343.     move.l    #Mode,-(sp)
  344.     move.l    #Mask,-(sp)
  345.     move.w    #$47,-(sp)
  346.     trap    #14
  347.     lea    10(sp),sp
  348.        
  349.   ASM 2:
  350.       include    XBIOS.EQU
  351.       
  352.     move.l    #Mode,-(sp)
  353.     move.l    #Mask,-(sp)
  354.       XBIOS    Vnext
  355.   C:        
  356.       #include    <dolmen.h>
  357.     int    Vnext(VDO_PARAM *Mask, VDO_PARAM *Mode);
  358.  
  359. Vvalid ($48)
  360. ------------
  361.  
  362.   Valid a video mode
  363.  
  364.     ...
  365.     
  366.   parameters:
  367.     word: handle to be tested.
  368.  
  369.   Answer:
  370.     D0=0 If the mode exist.
  371.     D0=-1 no mode for this hanlde.
  372.     
  373.   ASM 1: 
  374.     move.w    #Handle,-(sp)
  375.     move.w    #$48,-(sp)
  376.     trap    #14
  377.     addq.l    #4,sp
  378.        
  379.   ASM 2:
  380.       include    XBIOS.EQU
  381.       
  382.     move.w    #Handle,-(sp)
  383.       XBIOS    Vvalid
  384.   C:
  385.       #include    <dolmen.h>
  386.     int    Vvalid(int Handle);
  387.  
  388. Vload ($49)
  389. -----------
  390.  
  391.   Load VIDEO.DAT
  392.  
  393.     ...
  394.     
  395.   parameters:
  396.     Nothing
  397.  
  398.   Answer:
  399.     D0=0 : no error.
  400.     D0=-1 : file not found.
  401.  
  402.   ASM 1: 
  403.     move.w    #$49,-(sp)
  404.     trap    #14
  405.     addq.l    #2,sp
  406.        
  407.   ASM 2:
  408.       include    XBIOS.EQU
  409.       
  410.       XBIOS    Vload
  411.   C:
  412.       #include    <dolmen.h>
  413.     int    Vload(void);
  414.  
  415. Vsave ($4a)
  416. -----------
  417.  
  418.   Save VIDEO.DAT
  419.  
  420.     ...
  421.   
  422.   parameters:
  423.     Nothing
  424.  
  425.   Answer:
  426.     D0=0 : no error.
  427.     D0=-1 : save impossible.
  428.  
  429.   ASM 1: 
  430.     move.w    #$4a,-(sp)
  431.     trap    #14
  432.     addq.l    #2,sp
  433.        
  434.   ASM 2:
  435.       include    XBIOS.EQU
  436.       
  437.       XBIOS    Vsave
  438.   C:
  439.       #include    <dolmen.h>
  440.     int    Vsave(void);
  441.  
  442. Vopen ($4b)
  443. -----------
  444.  
  445.   Wake up the screen
  446.  
  447.     ...
  448.     
  449.   parameters:
  450.     Nothing
  451.  
  452.   Answer:
  453.     D0=0 : no error.
  454.     D0=-1 : improbable.
  455.  
  456.   ASM 1: 
  457.     move.w    #$4b,-(sp)
  458.     trap    #14
  459.     addq.l    #2,sp
  460.        
  461.   ASM 2:
  462.       include    XBIOS.EQU
  463.       
  464.       XBIOS    Vopen
  465.   C:
  466.       #include    <dolmen.h>
  467.     int    Vopen(void);
  468.  
  469. Vclose ($4c)
  470. ------------
  471.  
  472.   Shut down
  473.  
  474.     ...
  475.    
  476.   parameters:
  477.     Nothing
  478.  
  479.   Answer:
  480.     D0=0 : no error.
  481.     D0=-1 : improbable.
  482.  
  483.   ASM 1: 
  484.     move.w    #$4c,-(sp)
  485.     trap    #14
  486.     addq.l    #2,sp
  487.        
  488.   ASM 2:
  489.       include    XBIOS.EQU
  490.       
  491.       XBIOS    Vclose
  492.   C:
  493.       #include    <dolmen.h>
  494.     int    Vclose(void);
  495.  
  496. Vscroll ($4d)
  497. -------------
  498.  
  499.   Choose the method of scrolling
  500.  
  501.     ...
  502.     
  503.   parameters:
  504.     word: new methode to use
  505.  
  506.            0: edge scrolling (default methode)
  507.            1: proportionnal scrolling
  508.            2: focus scrolling
  509.  
  510.   Answer:
  511.     D0: the old methode
  512.  
  513.   ASM 1: 
  514.     move.w    #ScrollMode,-(sp)
  515.     move.w    #$4d,-(sp)
  516.     trap    #14
  517.     addq.l    #4,sp
  518.        
  519.   ASM 2:
  520.       include    XBIOS.EQU
  521.       
  522.     move.w    #ScrollMode,-(sp)
  523.       XBIOS    Vscroll
  524.   C:
  525.       #include    <dolmen.h>
  526.     int    Vscroll(int ScrollMode);
  527.  
  528.  
  529. Voffset ($4e)
  530. -------------
  531.  
  532.   Locating of the virtual screen
  533.  
  534.     It return the position in relation to the top left corner of the physical
  535.   screen in the virtual screen.
  536.     
  537.   parameters:
  538.     Nothing
  539.  
  540.   Answer:
  541.     D0 hold the actual position with x in the high word and y in the low
  542.        word.
  543.  
  544.  
  545.   ASM 1: 
  546.     move.w    #$4e,-(sp)
  547.     trap    #14
  548.     addq.l    #2,sp
  549.        
  550.   ASM 2:
  551.       include    XBIOS.EQU
  552.       
  553.       XBIOS    Voffset
  554.   C:
  555.       #include    <dolmen.h>
  556.     int    Voffset(void);
  557.  
  558. Vseek ($4f)
  559. -----------
  560.  
  561.   Locate the virtual screen
  562.  
  563.     ...
  564.  
  565.   parameters:
  566.     word: x
  567.     word: y
  568.  
  569.   Answer:
  570.     D0 hold the old position with x in the high word and y in the low
  571.        word.
  572.  
  573.  
  574.   ASM 1: 
  575.     move.w    #$4f,-(sp)
  576.     trap    #14
  577.     addq.l    #2,sp
  578.        
  579.   ASM 2:
  580.       include    XBIOS.EQU
  581.       
  582.       XBIOS    Vseek
  583.   C:
  584.       #include    <dolmen.h>
  585.       VPOS    result;
  586.         *(long *)&result = Vseek(10, 10);
  587.     
  588.     VPOS    Voffset(void);
  589.  
  590. Vlock ($50)
  591. -----------
  592.  
  593.   Lock the virtual screen
  594.  
  595.     ...
  596.  
  597.   parameters:
  598.     word: command
  599.          0: the mouse can move the virtual screen
  600.          1: the mouse can not mode the virtual screen
  601.  
  602.   Answer:
  603.     D0 the old configuration.
  604.  
  605.   ASM 1: 
  606.     move.w    #Cmd,-(sp)
  607.     move.w    #$50,-(sp)
  608.     trap    #14
  609.     addq.l    #4,sp
  610.        
  611.   ASM 2:
  612.       include    XBIOS.EQU
  613.       
  614.     move.w    #Cmd,-(sp)
  615.       XBIOS    Vlock
  616.   C:
  617.       #include    <dolmen.h>
  618.     int    Vlock(int Cmd);
  619.  
  620. SetMon ($51)
  621. ------------
  622.  
  623.   Set the monitor's kind
  624.  
  625.     ...
  626.  
  627.   parameters:
  628.     word: new kind of monitor
  629.            0: SM124 ( prehistorical screen of the ST )
  630.            1: RGB ( TV's like screen, ideal to make blind... )
  631.            2: VGA ( a real monitor to work! )
  632.            3: TV ( worst RGB, all user are blind... )
  633.  
  634.   Answer:
  635.     D0: the kind of screen.
  636.  
  637.   ASM 1: 
  638.     move.w    #MonType,-(sp)
  639.     move.w    #$51,-(sp)
  640.     trap    #14
  641.     addq.l    #4,sp
  642.        
  643.   ASM 2:
  644.       include    XBIOS.EQU
  645.       
  646.     move.w    #MonType,-(sp)
  647.       XBIOS    SetMon
  648.  
  649.   C:
  650.       #include    <dolmen.h>
  651.     int    SetMon(int MontType);
  652.  
  653. MultiMon ($52)
  654. --------------
  655.  
  656.   Multisynchro mode
  657.  
  658.     You can authorise the switch between RGB and VGA.
  659.  
  660.   parameters:
  661.     word:
  662.         0 : forbidden the switchs.
  663.         >0 : authorise the switchs.
  664.         -1: the actual mode.
  665.  
  666.   Answer:
  667.     D0: the old mode.
  668.  
  669.   ASM 1: 
  670.     move.w    #Cmd,-(sp)
  671.     move.w    #$52,-(sp)
  672.     trap    #14
  673.     addq.l    #4,sp
  674.        
  675.   ASM 2:
  676.       include    XBIOS.EQU
  677.       
  678.     move.w    #Cmd,-(sp)
  679.       XBIOS    MultiMon
  680.  
  681.   C:
  682.       #include    <dolmen.h>
  683.     int    MultiMon(int Cmd);
  684.  
  685. SizeComp ($53)
  686. --------------
  687.  
  688.   Vgetsize compatibility
  689.  
  690.     ...
  691.     
  692.   parameters:
  693.     word:
  694.         0 : return the real size of the original screen. Put the hight bit to 1
  695.             to return the extended size of the video mode.
  696.         >0 : return the extended size.
  697.         -1: the actual mode.
  698.  
  699.   Answer:
  700.     D0: the old mode.
  701.  
  702.   ASM 1: 
  703.     move.w    #$53,-(sp)
  704.     trap    #14
  705.     addq.l    #2,sp
  706.        
  707.   ASM 2:
  708.       include    XBIOS.EQU
  709.       
  710.       XBIOS    VSizeComp
  711.   C:
  712.       #include    <dolmen.h>
  713.     int    VSizeComp(void);
  714.  
  715. Vsize ($54)
  716. -----------
  717.  
  718.   Return the size of the screen
  719.  
  720.     This functions allow you to know the size of a screen with input
  721.   parameters.
  722.   
  723.     If you put -1 for handle, the current handle is take by default and
  724.   reference.
  725.   
  726.     The function read only the logical parameter (no if -1) and the virtual
  727.   flag (no if -1).
  728.  
  729.   Parameters:
  730.     Long: in-array
  731.  
  732.   Answer:
  733.     D0 hold the size in bytes.
  734.     0 for error (bad parameters ?!)
  735.  
  736.   ASM 1: 
  737.     move.l    #Mode,-(sp)
  738.     move.w    #$53,-(sp)
  739.     trap    #14
  740.     addq.l    #6,sp
  741.        
  742.   ASM 2:
  743.       include    XBIOS.EQU
  744.       
  745.       pea    Mode
  746.       XBIOS    Vsize
  747.   C:
  748.           To do ...
  749.           
  750. Vsetmode ($58)
  751. --------------
  752.  
  753.   Set a new resolution
  754.  
  755.     if the high bit of the video mode is put to 1, it run an extended screen
  756.   like Setscreen.
  757.  
  758.   parameters:
  759.     Mode (word): the new mode
  760.   Answer:
  761.     D0 (word): the old mode
  762.  
  763.   ASM 1: 
  764.     move.w    #ModeVideo,-(sp)
  765.     move.w    #$58,-(sp)
  766.     trap    #14
  767.     addq.l    #4,sp
  768.        
  769.   ASM 2:
  770.       include    XBIOS.EQU
  771.       
  772.     move.w    #ModeVideo,-(sp)
  773.       XBIOS    Vsetmode
  774.   C:
  775.       #include    <tos.h>
  776.  
  777.  
  778. Montype ($59)
  779. -------------
  780.  
  781.   What kind of monitor is connected
  782.  
  783.   parameters:
  784.     Nothing
  785.     
  786.   Answer:
  787.     D0 (word):
  788.              0 -> SM124
  789.              1 -> RGB screen
  790.              2 -> VGA screen
  791.              3 -> TV screen
  792.  
  793.   ASM 1: 
  794.     move.w    #$59,-(sp)
  795.     trap    #14
  796.     addq.l    #2,sp
  797.        
  798.   ASM 2:
  799.       include    XBIOS.EQU
  800.       
  801.       XBIOS    MonType
  802.  
  803.   C:
  804.       #include    <tos.h>
  805.  
  806. VsetSync ($5a)
  807. --------------
  808.  
  809.   Set the video synchronisation
  810.  
  811.     ...
  812.  
  813.   parameters:
  814.     External (word): xxxx xxxx xxxx xHVC
  815.                     x réservé (à 0)
  816.                     H: external horizontal synchronisation
  817.                     V: idem in vertical
  818.                     C: external clock
  819.  
  820.   Answer:
  821.     D0=0 : no error.
  822.     D0=-1 : improbable.
  823.  
  824.   ASM 1: 
  825.     move.w    #Sync,-(sp)
  826.     move.w    #$5a,-(sp)
  827.     trap    #14
  828.     addq.l    #4,sp
  829.        
  830.   ASM 2:
  831.       include    XBIOS.EQU
  832.       
  833.     move.w    #Sync,-(sp)
  834.       XBIOS    VsetSync
  835.   C:
  836.       #include    <tos.h>
  837.  
  838. VgetSize ($5b)
  839. --------------
  840.  
  841.   Return the size of the actual screen
  842.   
  843.     ...
  844.  
  845.   parameters:
  846.     word: video mode
  847.  
  848.   Answer:
  849.     D0 (long): the size in bytes
  850.     
  851.   ASM 1: 
  852.     move.w    #$5b,-(sp)
  853.     trap    #14
  854.     addq.l    #2,sp
  855.        
  856.   ASM 2:
  857.       include    XBIOS.EQU
  858.       
  859.       XBIOS    VgetSize
  860.  
  861.   C:
  862.       #include    <tos.h>
  863.  
  864. VmodeValid ($5f)
  865. ----------------
  866.  
  867.   Valid a video mode
  868.  
  869.     It's an hidden call of the TOS.
  870.  
  871.     ...
  872.   
  873.   parameters:
  874.     word: video mode.
  875.     
  876.   Answer:
  877.     D0: the goog video mode.
  878.  
  879.   ASM 1: 
  880.     move.w    #$5f,-(sp)
  881.     trap    #14
  882.     addq.l    #2,sp
  883.        
  884.   ASM 2:
  885.       include    XBIOS.EQU
  886.       
  887.       XBIOS    VmodeValid
  888.  
  889.   C:
  890.       #include    <tos.h>
  891.  
  892.                 *--------End of the functions----------*
  893.  
  894. *-------------------------------------------------------------------------*
  895. *        STRUCTURE OF VIDEO XBIOS
  896. *-------------------------------------------------------------------------*
  897.  
  898.         *----------*
  899.         * CENTscreen majors vars (like for VIDEO.BRS) return by
  900.         * Dol_VarsLib.
  901.         * See Dolmen fo more informations
  902.         
  903.         RSRESET
  904.  
  905. vid_maj_vars    rs.l    1    ;pointer on major vars
  906. vid_cur_vars    rs.l    1    ;pointer on current vars
  907.  
  908. vid_shut_down    rs.l    1    ;Shut-down function
  909. vid_wake_up    rs.l    1    ;Wake-up function
  910.  
  911.         *----------*
  912.  
  913. *-------------------------------------------------------------------------*
  914.  
  915.         *----------*
  916.         * Structure of parameters for cookie "CNTS"
  917.  
  918.         RSRESET
  919.  
  920. cnts_name        rs.l    1    ;name of the cookie
  921. cnts_version    rs.l    1    ;number of the version 
  922.                 ; ex: 1.0.1 ($101)
  923. cnts_kbd_on    rs.b    1    ;flag for keyboard wake up
  924. cnts_midi_on    rs.b    1    ;idem for midi
  925. cnts_mouse_on    rs.b    1    ;idem for mouse
  926. cnts_joy_on    rs.b    1    ;idem for joysticks
  927. cnts_tst_eco    rs.b    1    ;hotkeys to shut down
  928. cnts_turbo_on    rs.b    1    ;turbo mouse
  929. cnts_turbo_speed    rs.b    1    ;turbo speed
  930.                 ; 1: Turtle (very slow)
  931.                 ; 2: Casimir (fast)
  932.                 ; 3: Hare (very fast)
  933.  
  934. *-------------------------------------------------------------------------*
  935.  
  936.         *-------------*
  937.         * CURENTS VARS
  938.         *-------------*
  939.  
  940.         RSRESET
  941.  
  942. vid_BUG_DAT    rs.b    1    ;error during load VIDEO.DAT
  943. vid_new_dat    rs.b    1    ;...
  944. vid_OK_VBL    rs.b    1    ;VBL flag
  945. vid_OK_TIMERC    rs.b    1    ;TIMERC flag
  946.  
  947. vid_monitor    rs.w    1    ;...
  948. vid_pal        rs.w    1    ;flag pal/ntsc
  949.  
  950. vid_xbios_mode    rs.w    1    ;video mode system
  951. vid_cur_mode    rs.w    1    ;current video mode
  952.  
  953. vid_multisync    rs.b    1    ;...
  954. vid_size_comp    rs.b    1    ;...
  955.  
  956.  
  957.  
  958.  
  959. vid_phys_chg    rs.b    1    ;flags indicate that a part of the video
  960. vid_log_chg    rs.b    1    ;sub-system was changed. (only for Dolmen)
  961. vid_vid_chg    rs.b    1    ;
  962. vid_vdi_chg    rs.b    1    ;Initialise the VDI
  963.  
  964. vid_col_chg    rs.b    1    ;...
  965. vid_palst        rs.b    1    ;...
  966.         
  967. vid_BIG_FLAG    rs.b    1    ;Virtual mode
  968. vid_SCROLL    rs.b    1    ;scoll...
  969. vid_newpos    rs.b    1    ;new coordinate
  970. vid_freeze    rs.b    1    ;no scrolling
  971.         rs.b    1    ;reserved
  972. vid_scroll_mth    rs.w    1    ;methode of scrolling from 0 to 2
  973.  
  974. vid_ECO_FLAG    rs.b    1    ;ECO mode run
  975.         rs.b    1    
  976.  
  977. vid_NIGHT_FLAG    rs.b    1    ;...
  978. vid_ENERGY_FLAG    rs.b    1    ;...
  979. vid_eco2_extinction    rs.b    1    ;...
  980. vid_eco2_night_flag    rs.b    1    ;...
  981.  
  982. vid_eco_delay    rs.l    1    ;...
  983. vid_eco2_delay    rs.l    1    ;...
  984. vid_eco_counter    rs.l    1    ;... 
  985.  
  986. *-------------------------------------------------------------------------*
  987.  
  988.         *-------------*
  989.         * VARIABLES PRINCIPALES
  990.         *-------------*
  991.  
  992.         RSRESET
  993.  
  994. vid_dat_adr    rs.l    1    ;...
  995. vid_dat_len    rs.l    1    ;...
  996. vid_dat_len_MAX    rs.l    1    ;...
  997.  
  998. vid_cfg_adr    rs.l    1    ;...
  999. max_handle    rs.w    1    ;...
  1000.  
  1001.         *-------------*
  1002.  
  1003. vid_cfg_param    rs.l    1    ;...
  1004.  
  1005. vid_screen_param    rs.l    1    ;...
  1006. vid_videl_param    rs.l    1    ;...
  1007.  
  1008. vid_phys_adr    rs.l    1    ;...
  1009. vid_log_adr    rs.l    1    :...
  1010.  
  1011.         *-------------*
  1012.         
  1013. vid_handle    rs.w    1    ;...
  1014.  
  1015. vid_phys_w    rs.w    1    ;...
  1016. vid_phys_h    rs.w    1    ;...
  1017. vid_plan        rs.w    1    ;...
  1018. vid_log_w        rs.w    1    ;...
  1019. vid_log_h        rs.w    1    ;...
  1020. vid_wsize        rs.w    1    ;...
  1021. vid_hsize        rs.w    1    ;...
  1022.  
  1023. vid_scrn_size    rs.l    1    ;...
  1024.         
  1025.         *-------------*
  1026.         * for virtual screen ...
  1027.  
  1028. vid_newx        rs.w    1    ;...
  1029. vid_newy        rs.w    1    ;...
  1030.  
  1031.         *-------------*
  1032.  
  1033. *-------------------------------------------------------------------------*
  1034.  
  1035.         *-------------*
  1036.         * Structure of .DAT file
  1037.         *-------------*
  1038.  
  1039.         * Hardware address
  1040.         
  1041. _HHT        EQU    $FFFF8282
  1042. _HBB        EQU    $FFFF8284
  1043. _HBE        EQU    $FFFF8286
  1044. _HDB        EQU    $FFFF8288
  1045. _HDE        EQU    $FFFF828A
  1046. _HSS        EQU    $FFFF828C
  1047. _HFS        EQU    $FFFF828E
  1048. _HEE        EQU    $FFFF8290
  1049.  
  1050. _VFT        EQU    $FFFF82A2
  1051. _VBB        EQU    $FFFF82A4
  1052. _VBE        EQU    $FFFF82A6
  1053. _VDB        EQU    $FFFF82A8
  1054. _VDE        EQU    $FFFF82AA
  1055. _VSS        EQU    $FFFF82AC
  1056.  
  1057. _VCO        EQU    $FFFF82C0
  1058. _VMODE        EQU    $FFFF82C2
  1059.  
  1060. _SYNC        EQU    $FFFF820A
  1061. _OFFSET        EQU    $FFFF820E
  1062. _VWRAP        EQU    $FFFF8210
  1063.  
  1064. _SHIFT        EQU    $FFFF8260
  1065. _SPSHIFT        EQU    $ffff8266
  1066.  
  1067.         * bits position
  1068.         
  1069. flag_80c        EQU    3
  1070. flag_vga        EQU    4
  1071. flag_pal        EQU    5
  1072. flag_over        EQU    6
  1073. flag_st        EQU    7
  1074. flag_vert        EQU    8
  1075. flag_eco2        EQU    9
  1076. flag_eco        EQU    10
  1077. flag_virt        EQU    11
  1078. flag_extclk    EQU    12
  1079. flag_ext        EQU    13
  1080. flag_std        EQU    14
  1081. flag_set        EQU    15
  1082.  
  1083.         * masks
  1084.             ;FSOPV8NNN
  1085. _cols        equ    %000000111
  1086. _80c        equ    %000001000
  1087. _vga        equ    %000010000
  1088. _pal        equ    %000100000
  1089. _over        equ    %001000000
  1090. _st        equ    %010000000
  1091. _vert        equ    %100000000
  1092. _eco2        equ    %1000000000
  1093. _eco        equ    %10000000000
  1094. _virt        equ    %100000000000
  1095. _extclk        equ    %1000000000000
  1096. _ext        equ    %10000000000000
  1097. _std        equ    %100000000000000
  1098. _set        equ    %1000000000000000
  1099.  
  1100.             ;FSOPV8NNN
  1101. _setmod        equ    %110111111
  1102. _setvga        equ    %110011111
  1103. _setrgb        equ    %110101111
  1104. _setext        equ    $fe00
  1105. _setopt        equ    _set+_eco+_eco2+_virt
  1106.  
  1107.         *-------------*
  1108.         * struture of DAT
  1109.         *-------------*
  1110.  
  1111. dat_version    equ    $110    ;.DAT file version
  1112.         
  1113.         *-------------*
  1114.         * header
  1115.         RSRESET
  1116.  
  1117. dat_id        rs.l    1    ;name: "VDAT"
  1118. dat_ver        rs.w    1    ;version of the file
  1119. dat_head        rs.w    1    ;offset to the first mode
  1120.  
  1121. dat_multisync    rs.b    1    ;...
  1122. dat_size_comp    rs.b    1    ;...
  1123. dat_scroll    rs.b    1    ;...
  1124. dat_kbd_on    rs.b    1    ;...
  1125. dat_midi_on    rs.b    1    ;...
  1126. dat_mouse_on    rs.b    1    ;...
  1127. dat_joy_on    rs.b    1    ;...
  1128. dat_tst_eco    rs.b    1    ;...
  1129. dat_turbo_on    rs.b    1    ;...
  1130. dat_turbo_speed    rs.b    1    ;...
  1131.                 ;0: Casimir (comptatibilité)
  1132.                 ;1: Turtle
  1133.                 ;2: Casimir
  1134.                 ;3: Hare
  1135. dat_conf_end    rs.l    0
  1136.         
  1137.         RSSET    128
  1138. dat_modes        rs.l    0    ;end of header...
  1139.  
  1140.         RSRESET
  1141. dat_offset    rs.w    1    ;offset to the next mode
  1142. dat_datas        rs.l    0    ;datas of the mode
  1143.  
  1144.         *-------------*
  1145.         * video mode 1.00
  1146.         *-------------*
  1147.         
  1148.         RSRESET
  1149. dat_mode        rs.w    1    ;mode code xxxx xxxF SOPV 8NNN
  1150.                 ; STANDARD:
  1151.                 ; bit 0 à 2: NNN (nombre de plan)
  1152.                 ;    0-> monochrome
  1153.                 ;    1-> 2 planes
  1154.                 ;    2-> 4 planes
  1155.                 ;    3-> 8 planes
  1156.                 ;    4-> 16 planes (Near True Color)
  1157.                 ; bit 3: Flag 80 colums (8)
  1158.                 ; bit 4: Flag VGA (V)
  1159.                 ; bit 5: Flag Pal (P)
  1160.                 ; bit 6: Flag overscan (O)
  1161.                 ; bit 7: Flag ST compatible (S)
  1162.                 ; bit 8: Flag Vertical (F)
  1163.                 ; EXTEND:
  1164.                 ; bit 9: energy star on/off
  1165.                 ; bit 10: screen saver on/off
  1166.                 ; bit 11: virtual screen on/off
  1167.                 ; bit 12: external clock 32/36MHz (CT2)
  1168.                 ; bit 13: external clock on/off
  1169.                 ; bit 14: standard resolution (not deletable)
  1170.                 ; bit 15: default video mode for old functions
  1171.  
  1172. dat_physx        rs.w    1    ;physical x
  1173. dat_physy        rs.w    1    ;physical y
  1174. dat_plan        rs.w    1    ;number of plane
  1175. dat_logx        rs.w    1    ;virtual x
  1176. dat_logy        rs.w    1    ;virtual y
  1177.  
  1178. dat_eco_delay    rs.w    1    ;delay in seconds
  1179. dat_eco2_delay    rs.w    1    ;delay in seconds
  1180.  
  1181. dat_wsize        rs.w    1    ;Screen width in mm
  1182. dat_hsize        rs.w    1    ;Screen heigth in mm
  1183. dat_vars_end    rs.l    0
  1184.  
  1185.         * VIDEL registers
  1186.  
  1187.         RSSET    64-2
  1188. dat_videl        rs.l    0
  1189. dat_SPSHIFT    rs.w    1    ;...
  1190. dat_shift_write    rs.b    1    ;...
  1191. dat_SHIFT        rs.b    1    ;...
  1192. dat_VCO        rs.w    1    ;...
  1193. dat_VMODE        rs.w    1    ;...
  1194. dat_Hxx        rs.w    8    ;...
  1195. dat_Vxx        rs.w    6    ;...
  1196.  
  1197. dat_regs_end    rs.l    0
  1198.         
  1199.         RSSET    128-2
  1200.  
  1201. dat_name        rs.l    0    ;comments
  1202.  
  1203.         RSSET    192-2
  1204. dat_maxlength    rs.l    0    ;maximum lenght of a video mode
  1205.  
  1206.         *-------------*
  1207.  
  1208.  
  1209. *-------------------------------------------------------------------------*
  1210.  
  1211.         *-------------------*
  1212.         * Structure of an array for Vxxxx functions
  1213.         *-------------------*
  1214.         
  1215.         RSRESET
  1216.         
  1217. v_hdl        rs.w    1    ;handle of video mode
  1218. v_mode        rs.w    1    ;Falcon video mode
  1219.  
  1220. v_physx        rs.w    1    ;physical width
  1221. v_physy        rs.w    1    ;physical height
  1222. v_plan        rs.w    1    ;planes number
  1223. v_logx        rs.w    1    ;virtual width
  1224. v_logy        rs.w    1    ;virtual height
  1225. v_eco        rs.w    1    ;eco delay
  1226. v_eco2        rs.w    1    ;Energy Star delay
  1227. v_wsize        rs.w    1    ;Screen width in mm
  1228. v_hsize        rs.w    1    ;Screen heigth in mm
  1229.  
  1230. v_vars_end    rs.l    0
  1231.         
  1232.         RSSET    64
  1233. v_name        rs.l    0    ;name of the mode
  1234.  
  1235.         RSSET    128
  1236. v_length        rs.l    0    ;len of the array
  1237.  
  1238. *-------------------------------------------------------------------------*
  1239.  
  1240.  
  1241.                       *----------END----------*
  1242.